<template>
  <div>
    <el-button type="preview" @click="dialogVisible = true">预览</el-button>

    <el-dialog :title="modular" :visible.sync="dialogVisible" width="1160px">
      <h1>{{ruleForm.name ||ruleForm.title}}</h1>
      <h2>
        来源：{{ruleForm.source}}
        <span>|</span>
        发布时间：{{ruleForm.date}}
      </h2>
      <div class="ql-container ql-snow">
        <p class="ql-editor" v-html="ruleForm.text || ruleForm.context"></p>
      </div>
    </el-dialog>
  </div>
</template>

<script>
// import Send from "./send";
// import Success from "./success";

export default {
  components: {
    // Send,
    // Success,
  },
  data() {
    return {
      dialogVisible: false,
      nowTime: "",
    };
  },
  props: ["ruleForm", "modular", "showBetCode"],
  created() {
    this.getTime();
  },
  methods: {
    getTime() {
      this.nowTime = new Date().toLocaleString();
    },
  },
};
</script>

<style lang="less" scoped>
/deep/.el-dialog {
  min-height: 886px;
  margin-top: 8vh !important;
  border-radius: 8px;
  position: relative;

  .el-dialog__footer {
    position: absolute;
    bottom: 0;
  }

  > .el-dialog__header {
    padding: 15px 0px 15px 24px;
    background: rgba(230, 233, 237, 1);
    border-radius: 8px 8px 0 0;

    > .el-dialog__title {
      width: 90px;
      height: 16px;
      font-size: 18px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: rgba(51, 51, 51, 1);
    }

    > .el-dialog__headerbtn {
      right: 11px;
    }
  }

  > .el-dialog__body {
    padding: 30px 40px 20px 40px;

    > h1 {
      font-size: 28px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: rgba(51, 51, 51, 1);
      line-height: 28px;
      padding: 0px 0 25px 0;
      text-align: center;
    }

    > h2 {
      height: 22px;
      font-size: 16px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 22px;
      text-align: center;
      margin: 0 auto;
      padding-bottom: 30px;
      border-bottom: 1px solid #e8e8e8;
      margin-bottom: 23px;

      > span {
        display: inline-block;
        margin: 0 10px;
      }
    }

    .text-body {
      text-align: center;

      > p {
        font-size: 16px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: rgba(51, 51, 51, 1);
        line-height: 32px;
        margin-bottom: 32px;
        display: inline-block;
      }

      .indent-2 {
        text-indent: 2em;
      }
    }
  }
}

// .text-body {
//   text-align: center;
// }
// .text-body .textone {
//   display: inline-block;
//   text-align: left;
// }
/deep/.el-button--look {
  width: 60px;
  height: 28px;
  background: rgba(255, 255, 255, 1);
  border-radius: 4px;
  color: #333333;
  padding: 0;
  margin-right: 20px !important;
}

//send
.dialog-footer {
  .text-input {
    display: flex;
    margin-bottom: 20px;

    .title {
      width: 80px;
      height: 80px;
      font-size: 14px;
      line-height: 22px;
      color: rgba(51, 51, 51, 1);
      background: rgba(242, 242, 242, 1);
      border: 1px solid rgba(221, 221, 221, 1);
      padding: 18px 22px 0px 25px;
      white-space: normal;
    }

    > .el-textarea {
      /deep/ .el-textarea__inner {
        min-height: 80px !important;
        width: 1000px;
        padding-left: 9px;
      }
    }
  }

  .bt-group {
    display: flex;
    justify-content: flex-end;

    .el-button--default {
      width: 80px;
      height: 36px;
      background: rgba(251, 54, 63, 1);
      border-radius: 3px;
      border: 1px solid rgba(251, 54, 63, 1);
      padding: 0;
      color: #ffffff;
    }

    .el-button--primary {
      padding: 0;
      color: #ffffff;
      width: 80px;
      height: 36px;
      background: rgba(61, 127, 255, 1);
      border-radius: 3px;
    }
  }
}

//成功的样式
.dialog-footer {
  .text-input {
    display: flex;

    .title {
      width: 80px;
      height: 80px;
      font-size: 14px;
      line-height: 22px;
      color: rgba(51, 51, 51, 1);
      background: rgba(242, 242, 242, 1);
      border: 1px solid rgba(221, 221, 221, 1);
      padding: 18px 22px 0px 25px;
      white-space: normal;
    }

    .result {
      width: 1010px;
      height: 80px;
      background: rgba(242, 242, 242, 1);
      border: 1px solid rgba(221, 221, 221, 1);
      padding: 15px 0 0 9px;

      span {
        font-size: 14px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: rgba(51, 51, 51, 1);
        line-height: 22px;
      }

      .time {
        margin-right: 5px;
      }

      .name {
        margin-right: 30px;
      }

      .text-1 {
        margin-right: 5px;
      }

      .text-2 {
        margin-right: 30px;
      }

      .text-3 {
        margin-right: 5px;
      }
    }
  }
}

/deep/.el-button--preview {
  width: 70px;
  height: 36px;
  background: rgba(255, 255, 255, 1);
  border-radius: 4px;
  border: 1px solid rgba(61, 127, 255, 1);
  color: #3d7fff;
  padding: 0;
  margin-left: 10px;
  position: absolute;
  bottom: -30px;
}

/deep/.ql-container.ql-snow {
  // border: 1px solid #ccc;
  /* width: 1350px; */
  /* height: 300px; */
  border: none !important;
  width: 1100px !important;
  height: 100% !important;
}
</style>
